package com.itheima.mypack02;

public class Demo {
    private String name = "Demo";
    public static int age = 100;
    public static String room = "上海205";

    public void method1() {
        System.out.println("这是method1()方法！");
        System.out.println(name);
        System.out.println(age);
    }

    public static void method2() {
        System.out.println("这是method2()方法！！");
        System.out.println(age);
        // System.out.println(name); 报错，静态方法不能访问非静态变量
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

   /* public  int getAge() {
        return age;
    }

    public void setAge(int age) {
        Demo.age = age;
    }*/
}
